package com.rongshu.view.userInfo.presenter;

import android.content.Context;

import com.rongshu.api.RetorfitService;
import com.rongshu.view.base.mvp.BasePresenter;
import com.rongshu.view.userInfo.entity.CardBagInfo;
import com.rongshu.view.userInfo.iview.CardBagView;

import rx.Subscriber;

public class CardBagPresenter extends BasePresenter<CardBagView> {

    public CardBagPresenter(Context context) {
        super(context);
    }

    /**
     * 获取我的卡包
     */
    public void getMyProps(int user_id, String sign) {
        RetorfitService.getMyProps(user_id, sign)
                .subscribe(new Subscriber<CardBagInfo>() {
                    @Override
                    public void onCompleted() {

                    }

                    @Override
                    public void onError(Throwable e) {

                    }

                    @Override
                    public void onNext(CardBagInfo cardBagInfo) {
                        if (getView() != null) {
                            getView().onMyProps(cardBagInfo);
                        }
                    }
                });
    }
}
